<template>
  <div
    class="cardWall"
    v-loading="loading">
    <div
      class="cardWallTitle"
      v-if="hasCheck">
      <span>请选择本企业要交换的资料</span>
      <span class="total">
        已选择3项
      </span>
      <el-button type="text">清空</el-button>
    </div>
    <div class="cardPage">
      <el-card
        class="certificatesCard"
        v-for="i in 5"
        :key="'c'+i">
        <div
          slot="header">
          <p>证件照：4</p>
          <p>组名：产品线</p>
          <p>组编号：SFG2019年5月8日11:43:34</p>
        </div>
        <div>
          <el-button type="text">查看</el-button>
          <el-divider direction="vertical"/>
          <el-button
            type="text"
            class="delete">删除
          </el-button>
        </div>
        <el-checkbox
          v-if="hasCheck"
          class="cardCheck"/>
      </el-card>
      <el-card
        class="licenceCard"
        v-for="i in 3"
        :key="'l'+i">
        <p class="licenceCardTitle">
          三类医疗器械经营许可证
        </p>
        <div class="licenceDetail">
          <img
            src="http://temp.im/174x120"
            alt="">
          <div>
            <p>
              <span>有效期从</span>
              <span>2017-01-01</span>
            </p>
            <p>
              <span>截止日期</span>
              <span>2017-01-01</span>
            </p>
            <p>
              <span>长期有效</span>
              <span>2017-01-01</span>
            </p>
            <p>
              <span>证件编号</span>
              <span>8476598612786</span>
            </p>
            <p>
              <span>证件名称</span>
              <span>8476598612786</span>
            </p>
          </div>
        </div>
        <el-checkbox
          v-if="hasCheck"
          class="cardCheck"/>
      </el-card>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CardWall',
  data () {
    return {
      checked: '',
      dialogVisible: false
    }
  },
  props: {
    hasCheck: {
      type: Boolean,
      default: true
    },
    loading: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    open4 () {
      this.dialogVisible = true
    }
  }
}
</script>
<style lang="less" scoped>
  .cardCheck {
    position: absolute;
    right: 16px;
    top: 10px;
  }

  .qualificationCardwithImg {
    display: flex;
    align-items: center;
    margin-top: 12px;
  }

  .qualificationCardwithImg img {
    width: 100px;
    height: 60px;
    margin-right: 6px;
    cursor: pointer;
  }

  .cardWallTitle {
    height: 40px;
    line-height: 40px;
    background: #eef0f5;
    padding-left: 10px;
    margin-bottom: 20px;

    .total {
      margin: 0 24px 0 12px;
    }
  }

  // 证件card样式
  .cardPage {
    display: flex;
    flex-wrap: wrap;
    flex-grow: 1;
    align-content: flex-start;
    justify-content: start;
  }

  .certificatesCard {
    display: inline-block;
    width: 277px;
    height: 170px;
    border-radius: 0;
    box-shadow: initial;
    margin: 0 16px 20px 0;
    position: relative;

    .cardCheck {
      position: absolute;
      right: 17px;
      top: 12px;
    }
  }

  .delete {
    color: #e24156;
  }

  .licenceCard {
    display: inline-block;
    width: 376px;
    border-radius: 0;
    box-shadow: initial;
    margin: 0 16px 20px 0;
    position: relative;

    .licenceCardTitle {
      margin-bottom: 24px;
    }

    .licenceDetail {
      display: flex;

      img {
        margin-right: 10px;
        width: 174px;
        height: 120px;
      }

      p span:first-child {
        color: #93a0b2;
        margin-right: 4px;
      }
    }

    .cardCheck {
      position: absolute;
      right: 17px;
      top: 12px;
    }
  }
</style>
<style lang="less">
  .certificatesCard {
    .el-card__header {
      padding: 14px 20px;

      p {
        line-height: 32px;
      }
    }

    .el-card__body {
      padding: 7px 30px;

      > div {
        display: flex;
        justify-content: space-around;
      }

      .el-divider {
        height: 30px;
      }

      .el-button--medium {
        padding: 0;
      }
    }
  }
</style>
